﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Aleator.Core
{
    /// <summary>
    /// Abstraction of note factory
    /// </summary>
    abstract public class NoteFactory
    {
        /// <summary>
        /// Create default note
        /// </summary>
        /// <returns></returns>
        public abstract Note GetNote();

        /// <summary>
        /// Create chromatic note for circle of fifths
        /// </summary>
        /// <param name="note">Chromatic note this is based on</param>
        /// <param name="notename">Name of the note</param>
        /// <param name="noteID">Location on the MIDI keyboard</param>
        /// <param name="interval">Interval within the current scale</param>
        /// <param name="octave">Octave on the MIDI keyboard</param>
        /// <param name="accidental">Indicator of sharp, flat or natural adjustment</param>
        /// <returns></returns>
        public abstract Note GetNote(CircleOfFifths.ChromaticScaleNote note, string notename, int noteID, int interval, int octave, int accidental = 0);

        /// <summary>
        /// Create drum note
        /// </summary>
        /// <param name="location">Specific location within the measure this note is to be played at</param>
        /// <param name="measure">Measure this note is to be played within</param>
        /// <param name="note">Chromatic note that is the basis for this one</param>
        /// <param name="messageOnID">MIDI noteon message id</param>
        /// <param name="messageOffID">MIDI noteoff message id</param>
        /// <param name="phrase">Phrase this note is associated with</param>
        /// <param name="chord">Chord this note belongs to</param>
        /// <returns></returns>
        public abstract Note GetNote(int location, int measure, ConcreteNote note, int messageOnID, int messageOffID, ConcretePhrase phrase, string chord = null);

        /// <summary>
        /// Create tonal note for phrasing
        /// </summary>
        /// <param name="location">Specific location within the measure this note is to be played at</param>
        /// <param name="measure">Measure this note is to be played within</param>
        /// <param name="noteid">Location on the MIDI keyboard</param>
        /// <param name="messageOnID">MIDI noteon message id</param>
        /// <param name="messageOffID">MIDI noteoff message id</param>
        /// <param name="phrase">Phrase this note is associated with</param>
        /// <param name="chord">Chord this note belongs to (inapplicable for drum note)</param>
        /// <returns></returns>
        public abstract Note GetNote(int location, int measure, int noteid, int messageOnID, int messageOffID, ConcretePhrase phrase, string chord = null);
    }
}
